<!--
 * @Author: zhouwei wei.zhou@flip.fun
 * @Date: 2023-07-10 14:18:43
 * @LastEditors: zhouwei wei.zhou@flip.fun
 * @LastEditTime: 2024-05-06 15:14:32
 * @FilePath: /js_study/传值.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jsencrypt/3.2.1/jsencrypt.min.js"></script>
    <style>
        .a {
            background-size: contain;
            height: 50px;
            width: 100px;
            overflow: auto;
            word-break: break-all;
            background-color: cyan;
        }

        .b {
            background-color: red;
        }
    </style>

</head>
<script>

    const repository_list = [
        {
            "id": 35283,
            "name": "第五批品尊仓库",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 35285,
            "name": "第五批品尊发货仓库",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 39022,
            "name": "测试仓库",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 29827,
            "name": "1125开心仓",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 29828,
            "name": "Cain测试",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 29899,
            "name": "默认门店仓",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 29957,
            "name": "翻翻华东仓库",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 30147,
            "name": "自己的店",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 32492,
            "name": "仓库测试y",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 32672,
            "name": "658945",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 32673,
            "name": "哈哈哈",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 35772,
            "name": "hy总仓",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 37010,
            "name": "xn仓库",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 37358,
            "name": "YY-仓库",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 37436,
            "name": "仓库-辛淑媛",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 37437,
            "name": "仓库2号-辛淑媛",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 37462,
            "name": "仓库测试-bt",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 38622,
            "name": "井岗山",
            "city": "武汉市",
            "type": "warehouse"
        },
        {
            "id": 38737,
            "name": "测试",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 39277,
            "name": "订货商城仓库",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 39328,
            "name": "订货商城发货开发测试",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 39339,
            "name": "订货商城测试仓库-上海",
            "city": "上海市",
            "type": "warehouse"
        },
        {
            "id": 39340,
            "name": "订货商城测试仓库-南京",
            "city": "南京市",
            "type": "warehouse"
        },
        {
            "id": 39440,
            "name": "柠檬森林苏州生鲜仓",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 39441,
            "name": "柠檬森林苏州常温仓",
            "city": "",
            "type": "warehouse"
        },
        {
            "id": 29822,
            "name": "Nicolas仓库",
            "city": "北京市",
            "type": "warehouse"
        },
        {
            "id": 20082,
            "name": "FLIPOS客服D店",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20083,
            "name": "井冈山",
            "city": "武汉市",
            "type": "branch"
        },
        {
            "id": 20084,
            "name": "FLIPOS线上培训店",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20085,
            "name": "%测试门店（勿动）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20086,
            "name": "商务演示店（孙莉）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20087,
            "name": "商务演示店（孙超）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20088,
            "name": "商务演示店（刘海骏）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20089,
            "name": "商务演示店（刘偲）",
            "city": "芜湖市",
            "type": "branch"
        },
        {
            "id": 20090,
            "name": "商务演示店（陈蒙蒙）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20091,
            "name": "商务演示店（黄艳）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20092,
            "name": " FLIPOS - Kiki演示店",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20093,
            "name": "丸子测试商户支付店（勿动）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20094,
            "name": "商务演示店（李伟）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20105,
            "name": "cococean（望京店）",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20106,
            "name": "GMSHANGHAI",
            "city": "北京市",
            "type": "branch"
        },
        {
            "id": 20107,
            "name": "客服测试门店A组",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20108,
            "name": "技术测试门店A",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 20109,
            "name": "柠檬森林加盟店",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 21165,
            "name": "柠檬森林直营店",
            "city": "上海市",
            "type": "branch"
        },
        {
            "id": 33508,
            "name": "技术测试门店LEO（勿动）",
            "city": "长沙市",
            "type": "branch"
        },
        {
            "id": 34634,
            "name": "测试号牌重复的问题",
            "city": "怀化市",
            "type": "branch"
        },
        {
            "id": 35727,
            "name": "技术测试门店ZxX",
            "city": "长沙市",
            "type": "branch"
        },
        {
            "id": 36148,
            "name": "2023线下见面会店1111",
            "city": "哈尔滨",
            "type": "branch"
        },
        {
            "id": 36675,
            "name": "布歌东京测试专用 - 勿动",
            "city": "襄阳市",
            "type": "branch"
        },
        {
            "id": 37382,
            "name": "cococean望京店aaaaa",
            "city": "北京市",
            "type": "branch"
        },
        {
            "id": 38381,
            "name": "技术支持测试门店（勿动）",
            "city": "上海市",
            "type": "branch"
        }
    ]
    const reg = new RegExp('柠檬', 'gi')
    const arr = repository_list.filter(item => {
        const bol = reg.test(item.name)
        // reg.lastIndex = 0
        console.log(bol);
        return bol
    })
    console.log(arr);
</script>

<body>
    <input class="a b" type="text" class="input">
    <button>清除</button>
</body>

<script>
    const arrs = []
    async function b() {
        return await new Promise((resolve, reject) => {
            reject(111)
        }).then(() => { }).catch(() => { })
    }
    async function a() {
        try {
            const res = await b()
            console.log(res);
            return res
        } catch (error) {
            console.log(error, 'error');
            return error
        }
    }
    ; (async () => {
        try {
            const res = await a()
            console.log(res);
        } catch (error) {
            console.log(error, 'error111111');
        }
    })()
</script>

</html>